package cn.gary.oaserver.controller;


import cn.gary.oaserver.entity.vo.AdminRoleVO;
import cn.gary.oaserver.params.Result;
import cn.gary.oaserver.service.ITAdminRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gary
 * @since 2024-03-15
 */
@RestController
@RequestMapping("/adminRole")
@Api("用户角色关联表")
public class TAdminRoleController {

    @Autowired
    ITAdminRoleService adminRoleService;

    @PostMapping("/addListAdminRole")
    @ApiOperation ( "用户关联角色" )
    public Result addListAdminRole(@RequestBody AdminRoleVO adminRoleVO){
        System.out.println (adminRoleVO );
        if (adminRoleService.addListAdminRole(adminRoleVO)){
            return Result.success ( "角色分配成功" );
        }else {
            return Result.error ( "角色分配失败" );
        }
    }

}
